﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using NHibernate.Context;
using System.Web;

namespace DocuServe.Data.Context
{
    internal class ManagedWebSessionContextManager : ISessionContextManager
    {
        #region ICurrentContextManager Members
        public void Bind(ISession session)
        {
            ManagedWebSessionContext.Bind(HttpContext.Current, session);
        }

        public bool HasBind(ISessionFactory sessionFactory)
        {
            return ManagedWebSessionContext.HasBind(HttpContext.Current, sessionFactory);
        }

        public void Unbind(ISessionFactory sessionFactory)
        {
            ManagedWebSessionContext.Unbind(HttpContext.Current, sessionFactory);
        }
        #endregion
    }
}
